<?php
class Solutions_content_Model extends ORM
{
	protected $table_name = 'solutions_content';
	protected $primary_key = 'solutions_content_id'; 
	protected $col_article_id = 'solutions_id';
	protected $col_language_id = 'languages_id';
	protected $sorting = array('solutions_content_id' => 'desc');
	
	public function get($article_id='',$language_id='')
	{
		$this->db->select('*');
		$this->db->from($this->table_name);		
		$this->db->orderby($this->primary_key,'desc');
		if($article_id) $this->db->where($this->col_article_id,$article_id);
		if($language_id) $this->db->where($this->col_language_id,$language_id);
		$query = $this->db->get();
		return $query->result_array(false);
		
	}
	
	public function get_article()
	{
		$this->db->select('*');
		$this->db->from('solutions');
		$this->db->join('solutions_content','solutions.solutions_id','solutions_content.solutions_id');
		$this->db->where('solutions_status',1);
		$this->db->orderby('solutions_sort_order','desc');	
		$this->db->orderby($this->primary_key,'desc');	
		$query = $this->db->get();
		return $query->result_array(false);
	}
}